<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./js/jQuery-3.7.1.js"></script>
    <script>
        function fun() {
            fetch('http://localhost:8080/fetch')
                .then(res => res.json())
                .then(data => console.log(data))
        }
    </script>
</head>
<body>
    <button onclick="fun()">按 钮</button>

</body>
</html>